﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Data.SqlClient;

/// <summary>
/// Summary description for Service
/// </summary>
public class Service : IBusinessEntity
{
    #region variables
        private string _serviceID = String.Empty;
        private string _serviceName = String.Empty;
        private string _serviceImage = String.Empty;
        private string _description = String.Empty;
    #endregion

    #region constructors
    public Service()
    {
        _serviceID = String.Empty;
        _serviceName=String.Empty;
        _serviceImage=String.Empty;
        _description = String.Empty;
    }

    public Service(string serviceID, string serviceName, string serviceImage, string serviceDescription)
    {
        _serviceID = serviceID;
        _serviceName = serviceName;
        _serviceImage = serviceImage;
        _description = serviceDescription;
    }
    #endregion

    #region Property
        public string ServiceID
        {
            get { return _serviceID; }
            set { _serviceID = value; }
        }
        public string ServiceName
        {
            get { return _serviceName; }
            set { _serviceName = value; }
        }
        public string ServiceImage
        {
            get { return _serviceImage; }
            set { _serviceImage = value; }
        }
        public string Description
        {
            get { return _description; }
            set { _description = value; }
        }
    #endregion

    #region Method
        public void Fill(SqlDataReader reader)
        {
            if (DAL.ColumnExists(reader, "ServiceID"))
            _serviceID = reader.GetInt32(0).ToString();
            if (DAL.ColumnExists(reader, "ServiceName"))
            _serviceName = reader.GetString(1);
            if (DAL.ColumnExists(reader, "ServiceImage") && !reader.IsDBNull(2))
            _serviceImage=reader.GetString(2);
            if (DAL.ColumnExists(reader, "Description") && !reader.IsDBNull(3))
            _description = reader.GetString(3);
        }

    #endregion
}
